home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / sampler4.arc / REGRESS.SAC < prev    next >
Text File  |  1985-08-30  |  10KB  |  324 lines

  1. !*******************************************************************!
  2. !                                                                   !
  3. !               Single Equation Estimation Techniques               !
  4. !                           (Chapter 9)                             !
  5. !                                                                   !
  6. !*******************************************************************!
  7. ON ECHO
  8.  
  9. !    This example demonstrates estimation techniques available in
  10. !    SORITEC Sampler.  Examples are taken from G.S. Maddala, 
  11. !    Econometrics, New York: McGraw-Hill, 1977.
  12. !
  13. !    The first example, which is taken from Maddala, p. 214-217 
  14. !    and p. 280-281, demonstrates the OLS, Cochrane-Orcutt 
  15. !    and Hildreth-Lu estimators.  The data are taken from J.C.G. Boot
  16. !    and G.M. Dewit, "Investment Demand: An Empirical Contribution to 
  17. !    the Aggregation Problem", International Economic Review, 1960,
  18. !    pp. 27-28.
  19. !
  20. !    Data can be read directly into SORITEC from a command file using
  21. !    the READ command.  First define the observation period with the
  22. !    USE command.
  23. !
  24.  
  25. USE 1934 1954
  26.  
  27. !
  28. !    When more than one variable is in the argument list, READ assigns
  29. !    variables by columns.
  30. !
  31. !    Read in G.M. data
  32. !
  33.  
  34. READ gm_investment gm_value gm_capital_stock
  35. MISSING 3078.5  2.8
  36. 317.6   4661.7  52.6
  37. 391.8   5387.1  156.9
  38. 410.6   2792.2  209.2
  39. 257.7   4313.2  203.4
  40. 330.8   4643.9  207.2
  41. 461.2   4551.2  255.2
  42. 512.0   3244.1  303.7
  43. 448.0   4053.7  264.1
  44. 499.6   4379.3  201.6
  45. 547.5   4840.9  265.0
  46. 561.2   4900.9  402.2
  47. 688.1   3526.5  761.5
  48. 568.9   3254.7  922.4
  49. 529.2   3700.2  1021.1
  50. 555.1   3755.6  1099.0
  51. 642.9   4833.0  1207.7
  52. 755.9   4924.9  1430.5
  53. 891.2   6241.7  1777.3
  54. 1304.4  5593.6  2226.3
  55. 1486.7  MISSING MISSING
  56. ;
  57.  
  58. !    
  59. !    Read in G.E. data
  60. !
  61.  
  62. READ ge_investment ge_value ge_capital_stock
  63. MISSING 1170.6   97.8
  64.  33.1   2015.8  104.4
  65.  45.0   2803.3  118.0
  66.  77.2   2039.7  156.2
  67.  44.6   2256.2  172.6
  68.  48.1   2132.2  186.6
  69.  74.4   1834.1  220.9
  70. 113.0   1588.0  287.8
  71.  91.9   1749.4  319.9
  72.  61.3   1687.2  321.3
  73.  56.8   2007.7  319.6
  74.  93.6   2208.3  346.0
  75. 159.9   1656.7  456.4
  76. 147.2   1604.4  543.4
  77. 146.3   1431.8  618.3
  78.  98.3   1610.5  647.4
  79.  93.5   1819.4  671.3
  80. 135.2   2079.7  726.1
  81. 157.3   2371.6  800.3
  82. 179.5   2759.9  888.9
  83. 189.6   MISSING MISSING
  84. ;
  85.  
  86. !
  87. !    Read in Westinghouse data
  88. !
  89.  
  90. READ west_investment west_value west_capital_stock
  91. MISSING   191.5      1.8
  92. 12.93     516.0       .8
  93. 25.90     729.0      7.4
  94. 35.05     560.4     18.1
  95. 22.89     519.9     23.5
  96. 18.84     628.5     26.5
  97. 28.57     537.1     36.2
  98. 48.51     561.2     60.8
  99. 43.34     617.2     84.4
  100. 37.02     626.7     91.2
  101. 37.81     737.2     92.4
  102. 39.27     760.5     86.0
  103. 53.46     581.4    111.1
  104. 55.56     662.3    130.6
  105. 49.56     583.8    141.8
  106. 32.04     635.2    136.7
  107. 32.24     723.8    129.7
  108. 54.38     864.1    145.5
  109. 71.78    1193.5    174.8
  110. 90.08    1188.9    213.5
  111. 68.60    MISSING   MISSING
  112. ;
  113. END
  114.  
  115. !
  116. !    Linear estimation of investment against value of the firm and
  117. !    capital stock, both lagged by one year is simple since lags
  118. !    can be specified directly in the command line.  First, change
  119. !    the USE period to account for the lagged variables:
  120. !
  121.  
  122. USE 1935 1954
  123.  
  124. !*******************************************************************!
  125. !                                                                   !
  126. !             Ordinary Least Squares Estimation                     !
  127. !                       (Section 9.1)                               !
  128. !                                                                   !
  129. !*******************************************************************!
  130.  
  131. !
  132. !    The OLS estimator is invoked by the REGRESS command:
  133. !
  134.  
  135. REGRESS gm_investment gm_value(-1) gm_capital_stock(-1)
  136.  
  137. !
  138. !    If you want to examine Beta coefficients and elasticities 
  139. !    associated with the coefficient estimates in OFF CRT mode,
  140. !    set the ON BETA flag, ie.
  141. !
  142.  
  143. ON BETA
  144.  
  145. REGRESS ge_investment ge_value(-1) ge_capital_stock(-1) 
  146.  
  147. !
  148. !    To plot actual versus fitted residuals, in addition to getting
  149. !    beta coefficients and elasticities, set the ON PLOT option.
  150. !
  151.  
  152. ON PLOT
  153.  
  154. !    
  155. !    Constraining the constant term to zero is enabled by including
  156. !    the ORIGIN argument in the REGRESS command, i.e.,
  157. !
  158.  
  159. REGRESS(ORIGIN) west_investment west_value(-1) west_capital_stock(-1)
  160.  
  161. !
  162. !    Remember you must explicitly disable global options you no longer need.
  163. !    
  164.  
  165. OFF BETA
  166. OFF PLOT
  167.  
  168. cls
  169. !*******************************************************************!
  170. !                                                                   !
  171. !             Cochran-Orcutt Iterative Technique                    !
  172. !                       (Section 9.2.1)                             !
  173. !                                                                   !
  174. !*******************************************************************!
  175.  
  176. !
  177. !    Cochrane-Orcutt and Hildreth-Lu estimators are used when residuals are
  178. !    first-order autoregressive.  Command syntax is identical to OLS 
  179. !    estimation; only the command name is different.  The Cochrane-Orcutt
  180. !    procedure is invoked by the command:
  181. !
  182.  
  183. CORC gm_investment gm_value(-1) gm_capital_stock(-1)
  184.  
  185. cls
  186. !*******************************************************************!
  187. !                                                                   !
  188. !                 Hildruth-Lu Scanning Technique                    !
  189. !                       (Section 9.2.2)                             !
  190. !                                                                   !
  191. !*******************************************************************!
  192.  
  193. !
  194. !    The Hildreth-Lu iterative procedure is invoked by the HILU 
  195. !    command.  There are one keyword and three optional positional 
  196. !    parameters that may be entered in the command line for constraining
  197. !    the fitted equation through the origin, defining lower and upper limits
  198. !    to RHO and defining the stepsize.  When the latter three arguments
  199. !    are omitted, they are assigned the initial values 0.0, 1.0 and
  200. !    0.1, respectively.  In this example, we use the default values for
  201. !    the lower and upper limits to RHO but redefine the stepsize to .05.
  202. !    Note that the first two positional parameters are assigned their
  203. !    default values by entering asterisks (*) in their respective
  204. !    positions.
  205. !
  206.  
  207. HILU(* * .05) ge_investment ge_value(-1) ge_capital_stock(-1)
  208.  
  209. cls
  210. !*******************************************************************!
  211. !                                                                   !
  212. !               Two-Stage Least Squares Estimation                  !
  213. !                         (Section 9.3)                             !
  214. !                                                                   !
  215. !*******************************************************************!
  216.  
  217. !
  218. !    Single equation estimation of a structural equation belonging
  219. !    to a general interdependent system of equations in SORITEC Sampler
  220. !    uses the two-stage least squares (2SLS) estimator, and is
  221. !    illustrated in the estimation of Klein's Model I. (See L.R. Klein,
  222. !    "Economic Fluctuations in the United States 1921-41," New York:
  223. !    John Wiley & Sons. 1950.
  224. !
  225. !    Annual data for consumption, profits, private wage bill, investment,
  226. !    capital stock, government wage bill, government expenditures and 
  227. !    taxes are imported to SORITEC Sampler through the READ command.
  228. !
  229.  
  230. USE 1920 1941
  231. READ consumption profits private_wages investment capital_stock &
  232.      government_wages government_expenditures taxes  
  233.     39.8 12.7 28.8  2.7 182.8   2.2  2.4  3.4
  234.     41.9 12.4 25.5 -0.2 182.6   2.7  3.9  7.7 
  235.     45.0 16.9 29.3  1.9 184.5   2.9  3.2  3.9 
  236.     49.2 18.4 34.1  5.2 189.7   2.9  2.8  4.7 
  237.     50.6 19.4 33.9  3.0 192.7   3.1  3.5  3.8 
  238.     52.6 20.1 35.4  5.1 197.8   3.2  3.3  5.5 
  239.     55.1 19.6 37.4  5.6 203.4   3.3  3.3  7.0 
  240.     56.2 19.8 37.9  4.2 207.6   3.6  4.0  6.7 
  241.     57.3 21.1 39.2  3.0 210.6   3.7  4.2  4.2 
  242.     57.8 21.7 41.3  5.1 215.7   4.0  4.1  4.0 
  243.     55.0 15.6 37.9  1.0 216.7   4.2  5.2  7.7 
  244.     50.9 11.4 34.5 -3.4 213.3   4.8  5.9  7.5 
  245.     45.6  7.0 29.0 -6.2 207.1   5.3  4.9  8.3 
  246.     46.5 11.2 28.5 -5.1 202.0   5.6  3.7  5.4 
  247.     48.7 12.3 30.6 -3.0 199.0   6.0  4.0  6.8 
  248.     51.3 14.0 33.2 -1.3 197.7   6.1  4.4  7.2 
  249.     57.7 17.6 36.8  2.1 199.8   7.4  2.9  8.3 
  250.     58.7 17.3 41.0  2.0 201.8   6.7  4.3  6.7 
  251.     57.5 15.3 38.2 -1.9 199.9   7.7  5.3  7.4 
  252.     61.6 19.0 41.6  1.3 201.2   7.8  6.6  8.9 
  253.     65.0 21.1 45.0  3.3 204.5   8.0  7.4  9.6 
  254.     69.7 23.5 53.3  4.9 MISSING 8.5 13.8 11.6 
  255.   ;
  256. END
  257.  
  258. !
  259. !    Define the identity income_net_of_taxes.
  260. !
  261.  
  262. identity income_net_of_taxes & 
  263.     net_income = private_wages + government_wages + profits
  264.  
  265. compute income_net_of_taxes
  266.  
  267. !
  268. !     Since SORITEC does not permit transformations in the estimation command
  269. !     line, compute (1) the sum of net_income and taxes less government wages
  270. !               and (2) the sum of private and government wages,
  271. !     as simple transformations.
  272. !
  273.  
  274. x = net_income + taxes - government_wages
  275.  
  276. total_wages = private_wages + government_wages
  277.  
  278. !
  279. !     The model consists of a consumption function, an investment
  280. !     function and a demand-for-labor function (expressed as the
  281. !     private wage bill), specified as:
  282. !
  283. !     consumption = a0 + a1*profits + a2*(total_wages) + a3*profits(-1)
  284. !
  285. !     investment = b0 + b1*profits + b2*profits(-1) + b3*capital_stock(-1)
  286. !
  287. !     private_wages = c0 + c1*x + c2*x(-1) + c3*time
  288. !
  289.  
  290. !
  291. !    Change to USE period to the estimation period.
  292. !
  293.  
  294. USE 1921 1941
  295.  
  296. !
  297. !    A dummy time series is generated simply by entering the TIME command.
  298. !
  299.  
  300. TIME time
  301.  
  302. !
  303. !    The TWOSTAGE command requires exogenous variables to be explicitly
  304. !    identified using the EXOGENOUS command.
  305. !
  306.  
  307. EXOGENOUS government_expenditures taxes government_wages profits(-1) &
  308.           capital_stock(-1) x(-1) time  
  309.  
  310. !
  311. !    Now simply estimate each equation of the model with the TWOSTAGE command.
  312. !
  313.  
  314. TWOSTAGE consumption profits total_wages profits(-1)
  315.  
  316. TWOSTAGE investment profits profits(-1) capital_stock(-1)
  317.  
  318. TWOSTAGE private_wages x x(-1) time
  319.  
  320. !
  321. !    That's it!
  322. !
  323. QUIT
  324.